package com.gopay.common.user.manager.impl;

import com.gopay.common.domain.user.PwdPrismMachine;
import com.gopay.common.user.dao.PwdPrismMachineDao;
import com.gopay.common.user.manager.PwdPrismMachineManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 设备信息
 * @author <a href="mailto:yhwpeng@126.com">wangdong</a>
 * @date 2017-05-05 16:44:36
 */
@Service(value = "pwdPrismMachineManager")
public class PwdPrismMachineManagerImpl implements PwdPrismMachineManager {
    protected final static Log logger = LogFactory.getLog(PwdPrismMachineManagerImpl.class);
    @Autowired
    public PwdPrismMachineDao pwdPrismMachineDao;

    @Override
    public PwdPrismMachine findById(Integer id){
        return pwdPrismMachineDao.find(PwdPrismMachine.class, id);
    }

    @Override
    public PwdPrismMachine findByMac(String mac){
        return pwdPrismMachineDao.findByMac(mac);
    }

    @Override
    public Integer savePwdPrismMachine(PwdPrismMachine info) {
        PwdPrismMachine save = null;
        try {
            save = pwdPrismMachineDao.save(info);
        }catch (Exception e){
        }
        return save.getId();
    }

    @Override
    public void editPwdPrismMachine(PwdPrismMachine info) {
        try {
            pwdPrismMachineDao.update(info);
        }catch (Exception e){
        }
    }

}
